home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.4 KB | 165 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Tracker.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef TRACKER_H
- #define TRACKER_H
-
- // ----- Part Layer -----
-
- #ifndef FWTRACKR_H
- #include "FWTrackr.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWINK_H
- #include "FWInk.h"
- #endif
-
- #ifndef FWSTYLE_H
- #include "FWStyle.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class CProxy;
- class FW_CScroller;
- class FW_CGraphicContext;
- class FW_CPoint;
-
- //========================================================================================
- // class CResizeTracker
- //========================================================================================
-
- class CResizeTracker : public FW_CTracker
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CResizeTracker( Environment* ev,
- FW_CView* view, ODFacet* facet,
- CProxy* theProxy, short whichHandle,
- const FW_CInk& resizeInk, const FW_CStyle& resizeStyle);
- virtual ~CResizeTracker();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void GetLastLocation(FW_CPoint& lastLocation)
- {lastLocation = fLastLocation;}
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CProxy* fProxy;
- short fWhichHandle;
- FW_Boolean fErase;
- FW_CInk fResizeInk;
- FW_CStyle fResizeStyle;
- FW_CPoint fDelta;
- FW_CPoint fLastLocation;
- FW_CScroller* fScroller;
- };
-
- //========================================================================================
- // class CTrackRect
- //========================================================================================
-
- class CTrackRect
- {
- public:
- CTrackRect(const FW_CInk& frameInk, const FW_CStyle& frameStyle);
- virtual ~CTrackRect();
-
- void TrackFeedback(Environment* ev, ODFacet* facet,
- FW_CGraphicContext& gc,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& currentPoint,
- FW_Boolean erase);
-
- void GetRectBounds(FW_CRect& bounds) const;
-
- private:
- void SetRectGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint);
-
- private:
- FW_CRect fRect;
- FW_CInk fFrameInk;
- FW_CStyle fFrameStyle;
- };
-
- //========================================================================================
- // class CSelectTracker
- //========================================================================================
-
- class CSelectTracker : public FW_CTracker
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CSelectTracker(Environment* ev,
- FW_CView* view,
- ODFacet* facet,
- CTrackRect* theShape);
- virtual ~CSelectTracker();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CTrackRect* fShape;
- FW_Boolean fErase;
- FW_CScroller* fScroller;
- };
-
- #endif